import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';


export const querySchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    fieldName: 'customerId',
    label: '客户ID',
  },
  {
    component: 'Input',
    fieldName: 'fromStaffId',
    label: '原负责员工ID',
  },
  {
    component: 'Input',
    fieldName: 'fromStaffName',
    label: '原负责员工姓名',
  },
  {
    component: 'Input',
    fieldName: 'toStaffId',
    label: '新负责员工ID',
  },
  {
    component: 'Input',
    fieldName: 'toStaffName',
    label: '新负责员工姓名',
  },
  {
    component: 'Input',
    fieldName: 'storeId',
    label: '店铺ID',
  },
  {
    component: 'Input',
    fieldName: 'storeName',
    label: '店铺名称',
  },
  {
    component: 'Textarea',
    fieldName: 'transferReason',
    label: '迁移原因',
  },
  {
    component: 'Select',
    componentProps: {
    },
    fieldName: 'transferType',
    label: '迁移类型：RESIGNATION-离职迁移，MANUAL-手动调整',
  },
  {
    component: 'Input',
    fieldName: 'operatorId',
    label: '操作人ID',
  },
  {
    component: 'Input',
    fieldName: 'operatorName',
    label: '操作人姓名',
  },
  {
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
    fieldName: 'transferDate',
    label: '迁移时间',
  },
];

// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
  { type: 'checkbox', width: 60 },
  {
    title: '主键ID',
    field: 'id',
  },
  {
    title: '客户ID',
    field: 'customerId',
  },
  {
    title: '原负责员工ID',
    field: 'fromStaffId',
  },
  {
    title: '原负责员工姓名',
    field: 'fromStaffName',
  },
  {
    title: '新负责员工ID',
    field: 'toStaffId',
  },
  {
    title: '新负责员工姓名',
    field: 'toStaffName',
  },
  {
    title: '店铺ID',
    field: 'storeId',
  },
  {
    title: '店铺名称',
    field: 'storeName',
  },
  {
    title: '迁移原因',
    field: 'transferReason',
  },
  {
    title: '迁移类型：RESIGNATION-离职迁移，MANUAL-手动调整',
    field: 'transferType',
  },
  {
    title: '操作人ID',
    field: 'operatorId',
  },
  {
    title: '操作人姓名',
    field: 'operatorName',
  },
  {
    title: '迁移时间',
    field: 'transferDate',
  },
  {
    title: '备注',
    field: 'remark',
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 180,
  },
];

